package com.ocom.human.controller;

import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.entity.master.EntityCompanyList;
import com.ocom.common.enums.ResultEnum;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.human.service.CompanyListService;
import com.ocom.human.service.WechatPerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CompanyController {

    @Autowired
    WechatPerInfoService wechatPerInfoService;


    @PostMapping(HumanServiceUrl.getCompanyIdsByOpenid)
    public Result getCompanyIdsByOpenid(String openid){
        List<Long>  list=wechatPerInfoService.getCompanyIdsByOpenid(openid);
        if(list!=null){
            return ResultUtil.success(list);
        }else{
            return ResultUtil.error(ResultEnum.Err_301);
        }
    }
}
